﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Flow_GetStaffInStep_Ex_V2]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Flow_GetStaffInStep_Ex_V2];
GO
CREATE PROCEDURE [dbo].[sproc_Flow_GetStaffInStep_Ex_V2]
    @DocID int
AS
BEGIN
SET NOCOUNT ON;

DECLARE @FlowID int;
DECLARE @StepID int;

SELECT @FlowID = flow_id, @StepID = step_id FROM dbo.UDS_Flow_Document WHERE doc_id = @docid;
IF ( @@ROWCOUNT = 1 )
BEGIN 
    exec dbo.[sproc_Flow_GetStaffInStep_V2] @FlowID = @FlowID, @StepID = @StepID;

    RETURN 0;
END
ELSE
BEGIN
    RETURN -1;
END

END
GO
